var app = sm("do_App");
var page = sm("do_Page");
var openHelper = require("helper/open");
var friendHelper = require("helper/friend");
var nf = deviceone.sm("do_Notification");

var lableA = ui("lableA");//"fontColor":"FF7E00FF"
var lableAfoot = ui("lableAfoot");//"bgColor":"FF7E00FF"
var lableB = ui("lableB");//"fontColor":"949EAAFF"
var lableBfoot = ui("lableBfoot");//"bgColor":"00000000"
var lableC = ui("lableC");//"fontColor":"949EAAFF"
var lableCfoot = ui("lableCfoot");//"bgColor":"00000000"

var root=ui("$");
//设置数据绑定的映射关系
root.setMapping({
	"labelNick.tag":"id",
	"labelNick.text":"nick",
	"imgUserLogo.tag":"bigFullLogo",
	"imgUserLogo.source":"fullLogo",
	"ALayoutA.tag" : "sex",
	"alayOutRight.visible" : "isFriend",
	"honorLevel.text" : "honorLevel",
	"honorValue.text" : "honorValue"
});

root.on("dataRefreshed", function(){
	var sex = ui("ALayoutA").tag;
	ui("lableA").text = (sex == "1") ? "他的":"她的";
	
});

ui("alayOutLeft").on("touch", function() {
  app.closePage();
});

ui("aLayoutLogo").on("touch", function(data, e) {
	var bigFullLogo = ui("imgUserLogo").tag;
	if(null!=bigFullLogo&&''!=bigFullLogo){
		var jsonImgs=[];
		jsonImgs.push({source:bigFullLogo});
		openHelper.open("source://view/reuse/imgBrowser.ui", {
			imgDatas :JSON.stringify(jsonImgs),index:0
		});
	}
});

ui("ALayoutA").on("touch", function(data, e) {
	lableA.fontColor = "FF7E00FF";
	lableAfoot.bgColor = "FF7E00FF";
	lableB.fontColor = "949EAAFF";
	lableBfoot.bgColor = "00000000";
	lableC.fontColor = "949EAAFF";
	lableCfoot.bgColor = "00000000";
	page.fire("user_her_tab_touch");
})

ui("ALayoutB").on("touch", function(data, e) {
	lableB.fontColor = "FF7E00FF";
	lableBfoot.bgColor = "FF7E00FF";
	lableA.fontColor = "949EAAFF";
	lableAfoot.bgColor = "00000000";
	lableC.fontColor = "949EAAFF";
	lableCfoot.bgColor = "00000000";
	page.fire("user_community_tab_touch");
})

ui("ALayoutC").on("touch", function(data, e) {
	lableC.fontColor = "FF7E00FF";
	lableCfoot.bgColor = "FF7E00FF";
	lableA.fontColor = "949EAAFF";
	lableAfoot.bgColor = "00000000";
	lableB.fontColor = "949EAAFF";
	lableBfoot.bgColor = "00000000";
	page.fire("user_circle_tab_touch");
})

ui("alayOutRight").on("touch", function() {
	//nf.toast("点击--右上角图标")
	page.fire("menusSHow");
});